package com.dubbo.impl;

import com.dubbo.api.CarInterface;

/**
 *
 * @author: mapengyong
 * @Date: 2021/1/20 1:10 下午
 * @Description:
 **/
public class CarWrapper implements CarInterface {

    private CarInterface carInterface;

    public CarWrapper(CarInterface carInterface) {
        this.carInterface = carInterface;
    }

    /**
     * 这样就可以在调用模板方法的前后执行自己的逻辑
     */
    @Override
    public void getColor() {
        System.out.println("这是包装对象");
        carInterface.getColor();
    }
}
